package autoBox;

/*
 * Author: JacksonCoder
 * FileName: autoBoxing
 * Version: 1.0.0
 */
public class autoBoxing {
    public static void main(String[] args) {
        int i = 100;
        
        Integer n = new Integer(i);
        System.out.println(n);
        Integer m = Integer.valueOf(i);
        System.out.println(m);
        Integer k = Integer.valueOf("100");
        System.out.println(k);

        int x = n.intValue();
        System.out.println("this is x:  " + n);
        System.out.println("===================");
        test();
    }

    static void test(){
        Integer x = 127;
        Integer y = 127;
        Integer m = 99999;
        Integer n = 99999;
        System.out.println("x == y: " + (x==y)); // true
        System.out.println("m == n: " + (m==n)); // false
        System.out.println("x.equals(y): " + x.equals(y)); // true
        System.out.println("m.equals(n): " + m.equals(n)); // true
    }
}
